package com.example.demobk.common;

import com.example.demobk.entity.Userinfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class UserSessionUtils {

    public static Userinfo getUser(HttpServletRequest request){
        HttpSession session = request.getSession();
        if (session != null&& session.getAttribute(AppVariable.USER_SESSION_KEY)!=null)
        {
            return (Userinfo) session.getAttribute(AppVariable.USER_SESSION_KEY);
        }
         return  null;

    }
}
